package com.ship.dispatch.bean.sys;

import com.baomidou.mybatisplus.annotation.TableName;
import com.ship.common.core.base.BaseBean;
import com.ship.common.core.mapping.ConstantTypeProvider;
import com.ship.common.core.mapping.Label;
import com.ship.common.core.mapping.SearchItem;
import com.ship.common.core.mapping.TableColumn;
import lombok.Data;

import javax.persistence.Column;


/**
 * @author 31463
 */
@TableName("constant")
@Data
public class SysConstant extends BaseBean {

    /**
	 *
	 */
	private static final long serialVersionUID = 1086836962184361736L;


    /**
     * 常量名
     */
    @Label("常量名")
    @SearchItem
    @Column(name = "const_label")
    @TableColumn
    private String constLabel;

    /**
     * 常量值
     */
    @Column(name = "const_value")
    @Label("常量值")
    @TableColumn
    private Integer constValue;

    /**
     * 常量类型：类型值，字符串，最大值20个字符
     */
    @Label(value = "类型", contentProvider = ConstantTypeProvider.class)
    @Column(name = "type")
    @TableColumn
    @SearchItem
    private String type;

    public String groupKey() {
        return groupKey(this.type);
    }

    public static String groupKey(String type) {
        return  type;
    }

}
